package com.anywhere.freightman.common.entity.car;

import java.text.ParseException;
import java.text.SimpleDateFormat;

public class TrackPoint {
    private double lat;
    private double lon;
    private String gtm;
    private long GpsTime;
    private double spd;
    private String mlg;
    private double hgt;
    private int agl;

    private long convertDate(String dateStr) throws ParseException {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd/HHmmss");
        return sdf.parse(dateStr).getTime();
    }

    public long getGpsTime() throws ParseException {
        return convertDate(gtm);
    }

    public double getLat() {
        return lat / 600000;
    }

    public void setLat(double lat) {
        this.lat = lat;
    }

    public double getLon() {
        return lon / 600000;
    }

    public void setLon(double lon) {
        this.lon = lon;
    }

    public String getGtm() {
        return gtm;
    }

    public void setGtm(String gtm) {
        this.gtm = gtm;
    }

    public double getSpd() {
        return spd;
    }

    public void setSpd(double spd) {
        this.spd = spd;
    }

    public String getMlg() {
        return mlg;
    }

    public void setMlg(String mlg) {
        this.mlg = mlg;
    }

    public double getHgt() {
        return hgt;
    }

    public void setHgt(double hgt) {
        this.hgt = hgt;
    }

    public int getAgl() {
        return agl;
    }

    public void setAgl(int agl) {
        this.agl = agl;
    }
}
